package com.yaowk.web.system.security;

import org.springframework.security.core.context.SecurityContextHolder;

public class SecurityUtils {
    public static UserInfo getUserInfo() {
        return (UserInfo) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }

    public static Integer getUserId() {
        return getUserInfo().getId();
    }
}
